import { NgModule, ErrorHandler, Optional, InjectionToken, Type, Injector, Provider, ReflectiveInjector } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpModule, Http } from '@angular/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DropdownModule, ListboxModule, ButtonModule, SharedModule } from 'primeng/primeng';

import { WitDemoTemplateModule } from 'p-wit-demo';
import { BaseServices } from 'wit-core';

import { AppComponent } from './app.component';
import { AppRouting } from './app.routing';
import { UUID, ICONTEXT_BROKER_TOKEN, AppContextBroker } from '../../src/index';
import { AppContextBrokerBasicComponent } from '../src/app-context-broker/basic/app-context-broker-basic.component';
import { AppContextBrokerCardComponent } from '../src/app-context-broker/card/app-context-broker-card.component';
import { AppContextBrokerDetailComponent } from '../src/app-context-broker/detail/app-context-broker-detail.component';
import { ContextCenterComponent } from '../src/context-center/context-center.component';
import { SharedContextBrokerBasicComponent } from '../src/shared-context-broker/basic/shared-context-broker-basic.component';
import { SharedContextBrokerCardComponent } from '../src/shared-context-broker/card/shared-context-broker-card.component';
import { SharedContextBrokerDetailComponent } from '../src/shared-context-broker/detail/shared-context-broker-detail.component';
import { B, C, A } from "./a";

export const APP_ID: InjectionToken<string> = new InjectionToken('APP_ID');
export function getUUID() {
  return UUID.next();
}

@NgModule({
  imports: [
    CommonModule,
    HttpModule,
    BrowserAnimationsModule,
    AppRouting,
    FormsModule,
    ReactiveFormsModule,
    DropdownModule,
    ListboxModule,
    ButtonModule,
    SharedModule,

    WitDemoTemplateModule,
  ],
  exports: [BrowserModule],
  declarations: [
    AppComponent,

    AppContextBrokerBasicComponent,
    AppContextBrokerCardComponent,
    AppContextBrokerDetailComponent,

    ContextCenterComponent,

    SharedContextBrokerBasicComponent,
    SharedContextBrokerCardComponent,
    SharedContextBrokerDetailComponent
  ],
  bootstrap: [AppComponent],
  providers: [
    {
      provide: APP_ID,
      useValue: (getUUID)
    },
    {
      provide: ICONTEXT_BROKER_TOKEN,
      useClass: AppContextBroker
    },
    BaseServices,
    B,
    C,
  ]
})
export class AppModule {



}




